package UserInterface;

import java.awt.GridLayout;
import java.awt.event.ActionListener;

import javax.swing.*;

public class NumberPanel extends JPanel{
	JButton[] numberButtonArray = new JButton[12];
	public JButton[] getButtons(){
		return numberButtonArray;
	}
	public void addActionListener(ActionListener list){
		for (int i=0;i<numberButtonArray.length;i++){
		numberButtonArray[i].addActionListener(list);
		}
	}
	private void makeNumberButton(){
		for(int i=0;i<9;i++){
			numberButtonArray[i]=new JButton(Integer.toString(i+1));
		}
		numberButtonArray[9]=new JButton("00");
		numberButtonArray[10]=new JButton(Integer.toString(0));
		numberButtonArray[11]=new JButton("000");
	}
	private void addToPanel(){
		for(int i=0;i<numberButtonArray.length;i++){
			this.add(numberButtonArray[i]);
		}
	}
	NumberPanel(){
		this.setLayout(new GridLayout(0,3));
		 makeNumberButton();
		 addToPanel();
	}
	
	NumberPanel(int width, int heigth){
		this.setSize(width,heigth);
		this.setLayout(new GridLayout(0,3));
		 makeNumberButton();
		 addToPanel();
	}
}
